package base.day07;

import javax.swing.*;

public class study1 {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setTitle("用户登录");
        jf.setSize(400, 300);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setAlwaysOnTop(true);
        jf.setLayout(null);
        //显示用户名文本
        JLabel usernamelable = new JLabel("用户名");
        usernamelable.setBounds(50, 50, 50, 20);
        jf.add(usernamelable);
        //用户名输入框
        JTextField usernameField = new JTextField();
        usernameField.setBounds(150, 50, 180, 20);
        jf.add(usernameField);
        //显示用户名文本
        JLabel passwordlable = new JLabel("密码");
        passwordlable.setBounds(50, 100, 50, 20);
        jf.add(passwordlable);
        //密码输入框
//        JTextField passwordField=new JTextField();
//        passwordField.setBounds(150,100,180,20);
//        jf.add(passwordField);


        //隐藏密码显示输入框
        JPasswordField passwordField = new JPasswordField();
        passwordField.setBounds(150, 100, 180, 20);
        jf.add(passwordField);

        //登录按钮
        JButton loginBtton = new JButton("登录");
        loginBtton.setBounds(50, 200, 280, 20);
        jf.add(loginBtton);

        jf.setVisible(true);
    }
}
